home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 1.iso
/
DEMON
/
RISCOS2
/
TCP_131S.ARC
/
h
/
global
< prev
next >
Wrap
Text File
|
1994-02-06
|
2KB
|
67 lines
/* Global definitions used by every source file.
* Some may be compiler dependent.
*/
#ifndef GLOBAL_H
#define GLOBAL_H
/* Indexes into binmode in files.c; hook for compilers that have special
* open modes for binary files
*/
#define READ_BINARY 0
#define WRITE_BINARY 1
extern char *binmode[];
/* These two lines assume that your compiler's longs are 32 bits and
* shorts are 16 bits. It is already assumed that chars are 8 bits,
* but it doesn't matter if they're signed or unsigned.
*/
typedef long int32; /* 32-bit signed integer */
typedef unsigned short int16; /* 16-bit unsigned integer */
#define uchar(x) (x)
#define MAXINT16 65535 /* Largest 16-bit integer */
/* Define null object pointer in case stdio.h isn't included */
#ifndef NULL
/* General purpose NULL pointer */
#define NULL (void *)0
#endif
#define NULLCHAR (char *)0 /* Null character pointer */
#define NULLFP (int (*)())0 /* Null pointer to function returning int */
#define NULLVFP (void (*)())0 /* Null pointer to function returning void */
#define NULLFILE (FILE *)0 /* Null file pointer */
/* General purpose function macros */
#define min(x,y) ((x)<(y)?(x):(y)) /* Lesser of two args */
#define max(x,y) ((x)>(y)?(x):(y)) /* Greater of two args */
/* Extract a short from a long */
/* Hacked these to see if it speeds things up */
#define hiword(x) ((int16) ((x) >> 16) & 0xFFFF)
#define loword(x) ((int16) ((x) & 0xFFFF))
/* Extract a byte from a short */
#define hibyte(x) (((x) >> 8) & 0xff)
#define lobyte(x) ((x) & 0xff)
/* Extract nibbles from a byte */
#define hinibble(x) (((x) >> 4) & 0xf)
#define lonibble(x) ((x) & 0xf)
char *strdup(char *); /* In MISC.H */
void *mem_malloc(unsigned int, char *, int);
void *mem_calloc(unsigned int, unsigned int, char *, int);
char *mem_strdup(char *, char *, int);
void mem_free(void *, char *, int);
#define MEM_NORMAL
#if !defined(MEM_NORMAL)
#define malloc(u) mem_malloc((u),__FILE__,__LINE__)
#define calloc(u,v) mem_calloc((u),(v),__FILE__,__LINE__)
#define strdup(s) mem_strdup((s),__FILE__,__LINE__)
#define free(p) mem_free((p),__FILE__,__LINE__)
#endif
#endif